# Create your views here.
from autores.forms import AutorForm, ExpertoAutorForm
from autores.models import Autor
from django.core.context_processors import csrf
from django.shortcuts import render_to_response
from django.template import RequestContext

def crear(request):
    c = {}
    form = AutorForm()
    autores = Autor.objects.all().order_by('orden')
    form_experto = ExpertoAutorForm()
    c.update(csrf(request))
    c.update({'form_autores' : form,'autores':autores})
    c.update({'form_expertos' : form_experto})
    return render_to_response("autores/crear.html", c,context_instance=RequestContext(request))



def crear_todos(request):
    c = {}
    form = AutorForm()
    autores = Autor.objects.all().order_by('orden')
    c.update(csrf(request))
    c.update({'form_autores' : form,'autores':autores}) 
    return render_to_response("autores/crear.html", c,context_instance=RequestContext(request))